package com.example.mqttledmenu;

import okhttp3.MultipartBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface UploadService {
    @POST("upload")
    @Multipart
    Call<ResponseBody> upload(@Part MultipartBody.Part file);

    @FormUrlEncoded
    @POST("login")
    Call<ResponseBody> login(@Field("userName") String username, @Field("userPassword") String password);

    @FormUrlEncoded
    @POST("changeInfo")
    Call<ResponseBody> changeInfo(@Field("userId") String userId, @Field("userAvatar") String avatar);

    @FormUrlEncoded
    @POST("publish")
    Call<ResponseBody> publish(@Field("userId") String userId,
                               @Field("title") String title,
                               @Field("content") String content,
                               @Field("newsAppendix") String newsAppendix);

}